import dynamic from 'dva/dynamic';
import {app} from '../index';

const dynamicComponent = (modules,loadComponent) => {
    return dynamic({
        app,
        models:() => modules.map((module)=>{
            return import(`../models/${module}`)
        }),
        component:loadComponent
    })
}

export default dynamicComponent